<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>演示bfc</title>
    <style>
        .container{
            background-color: #ccc;
        }
        img{
            width: 300px;
            float: left;
        }
        .bfc{
            overflow: hidden;
        }
    </style>
</head>
<body>

    <div class="container bfc">
        <img src="./avatar.jpg" alt="">
        <p class="bfc">这是文字</p>
    </div>
    
</body>
</html>